home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14606 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.compuserve.com!newsmaster
  2. From: 100435.736@compuserve.com (David A. Mair)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Directories under DOS
  5. Date: Mon, 01 Apr 1996 09:59:42 GMT
  6. Organization: CompuServe Incorporated
  7. Message-ID: <4jo61f$3f4@arl-news-svc-4.compuserve.com>
  8. References: <4j6obs$htl@newsbf02.news.aol.com>
  9. NNTP-Posting-Host: dd35-167.compuserve.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. jacqimarie@aol.com (Jacqimarie) wrote:
  13.  
  14. >I am writing several programs that must search large directories
  15. >frequently (it is not uncommon to have close to 2000 entries in one
  16. >directory).  Right now, I am using the functions findfirst and findnext,
  17. >and I am wondering if anybody could point me to faster, more efficient
  18. >functions to read directories.  The only information I need from the
  19. >directory is the filename and the status of the archive bit.
  20.  
  21. One of the deficiences of MS-DOS is that the more files you have in a
  22. directory the slower file system operations become in that directory.
  23. The best way to improve performance is to open the directory as a file
  24. (apart from the root directory it is stored just like a file).  You
  25. may have to read the file system structures yourself to do this.  You
  26. can then read the entire directory into memory in a single operation
  27. and access it at memory speed.  You can even organise it to suit your
  28. application.  The Microsoft MS-DOS programmer's reference will help
  29. you build the structures to manage the directory (which is just an
  30. array of these structures).
  31.  
  32. Regards
  33. David.
  34.  
  35.